<!DOCTYPE html>
<html>
    <head lang="en">
        <meta charset="utf-8"/>
        <title>网站后台管理</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        <link rel="stylesheet" href="${e.res('/css/bootstrap.min.css')}">
        <link rel="stylesheet" href="${e.res('/css/font-awesome.min.css')}">
        <link rel="stylesheet" href="${e.res('/css/ace.min.css')}">
        <script src="${e.res('/js/jquery-1.4.3.min.js')}"></script>
        <script src="${e.res('/js/errorHander.js')}"></script>
    </head>
    <body>
        <#include "/pages/moudle/BackHead.ftl">
        <div class="main-container" id="main-container">
            <div class="main-container-inner">
            <#include "/pages/moudle/BackSideBar.ftl">
            <@backSideBar chooseTag = '3' />
                <!--页面主体内容-->
        <div class="main-content">
            <!-- 面包屑 -->
            <div class="breadcrumbs" id="breadcrumbs">

                <ul class="breadcrumb">
                    <li>
                        <i class="icon-home home-icon"></i>
                        <a href="#">首页</a>
                    </li>

                    <li>
                        <a href="/valuation/list">评价管理</a>
                    </li>
                    <li class="active">评价编辑</li>
                </ul>
            </div>
            <!-- 面包屑 -->

            <div class="page-content">
                <div class="page-header">
                    <h1>
                        评价编辑
                        <small>
                            <i class="icon-double-angle-right"></i>
                            编辑评价
                        </small>
                    </h1>
                </div>
                <!-- /.page-header -->

                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->

                        <form class="form-horizontal" role="form" id="valuation-edit" action="/valuation/update" method="post" enctype="multipart/form-data">
                            <input type="hidden" name="evalId" value="${evalInfo.evalId}"/>
                            <div class="form-group">
                                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 评价标题 </label>

                                <div class="col-sm-9">
                                    <input type="text" id="form-field-title" value="${evalInfo.evalTitle}"
                                           class="col-xs-10 col-sm-5" name="title"/>
                                </div>
                            </div>

                            <div class="space-4"></div>

                            <div class="form-group">
                                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 评价描述 </label>

                                <div class="col-sm-9">
                                    <textarea class="form-control limited" id="form-field-textarea" maxlength="50"
                                              style="width:600px;height: 150px;" name="description">${evalInfo.evalDesc}</textarea>
                                </div>
                            </div>

                            <div class="space-4"></div>
                            
                            <div class="form-group">
                                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 评价内容 </label>

                                <div class="col-sm-9">
                                    <input type="file" id="form-field-file" name="pdf"/>
                                </div>
                            </div>

                            <div class="space-4"></div>

                            <div class="clearfix form-actions">
                                <div class="center">
                                    <button class="btn btn-info" type="button" id="button">
                                        <i class="icon-ok bigger-110"></i>
                                        保存
                                    </button>

                                    &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;
                                    <a href="/valuation/list" class="btn" type="reset">
                                        <i class="icon-undo bigger-110"></i>
                                        返回
                                    </a>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <!--页面主题内容结束-->
            </div>
        </div>
    </body>
    <script>
        $("#button").click(function() {
        if ($("#form-field-title").val().trim() == "") {
            alert("请先输入评价标题");
            return;
        }
        if ($("#form-field-textarea").val().trim() == "") {
            alert("请先输入评价描述");
            return;
        }
        var file = $("#form-field-file").val();
        if (file != "") {
            var last = file.lastIndexOf(".");
            var type = file.substring(last + 1);
            if (type != "pdf") {
                alert("文件格式不正确");
                return;
            }
         }
        $("#valuation-edit").submit();
    });
    </script>
</html>